import React,{useEffect,useState} from 'react';

export let useWindowchange = ()=>{
    let [width,setWidh] = useState("0px")
    let [height,setHeight] = useState("0px")
    useEffect(()=>{
        setWidh(document.documentElement.clientWidth)
        setHeight(document.documentElement.clientHeight)
    },[])
    useEffect(()=>{
        let handleresize = ()=>{
          setWidh(document.documentElement.clientWidth)
          setHeight(document.documentElement.clientHeight)
        }
        window.addEventListener("resize",handleresize,false)
    },[])
    return [width,height]
}